---攻击的敌人距离自己越远，伤害加成越高，最多加成30%伤害（隐藏机制：每0.3码加成1%，不足0.3不计算）
---@class BuffEffect420006100:BaseBuffEffect
BuffEffect420006100 = ClientFight.CreateClass("BuffEffect420006100",ClientFight.BaseBuffEffect)
local t = BuffEffect420006100
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...}
    if (not (parameters[1].__cname == Fighter.__cname)) then
        return IBuffEffect.FAIL;
    end
    if (not (parameters[3].__cname == FightResult.__cname))then
        return IBuffEffect.FAIL;
    end
    local attTarget = parameters[1]--//我攻击的目标
    local result = parameters[3];
    if (not result:isDamage()) then
        return IBuffEffect.FAIL;
    end
    if (not AttackUtils.isDamage(result:getState())) then
        return IBuffEffect.FAIL;
    end
    local dis = DistanceUtil.countDistance(buff.target.position, attTarget.position)
    local buffEffectValue = buff.buffBean.f_BuffEffectValue
    local cofDis = Utils.toRatio(buffEffectValue[1]);
    if (dis < cofDis) then
        return IBuffEffect.FAIL;
    end
    local step = math.floor(dis / cofDis);
    if (step < 1) then
        return IBuffEffect.FAIL;
    end
    local ratio = step * buffEffectValue[2];
    if (ratio > buffEffectValue[3]) then
        ratio = buffEffectValue[3];
    end
    local damage = result:getDamage();
    local addDamage = math.floor(Utils.toRatio(ratio) * result:getDamage())
    if (addDamage < 1) then
        return IBuffEffect.FAIL;
    end
    result:setDamage(damage + addDamage);
    --local logratio = ratio;
    SkillRoleMgr.savePathFile( string.format("[%s][EFFECT]Fighter %s buff%s 伤害随着距离增加而增加 : %s , 原始伤害: %s, 加成系数: %s",
    fight.frame, buff.target.fighterId, buff.modelId, addDamage, damage, logratio));
    return ClientFight.BaseBuffEffect.action(self,fight, buff, ...);
end
t.New()